package com.jeejam.storage.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jeejam.framework.base.service.impl.BaseServiceImpl;
import com.jeejam.storage.dao.StorageMapper;
import com.jeejam.storage.pojo.Storage;
import com.jeejam.storage.service.StorageService;

@Service
public class StorageServiceImpl extends BaseServiceImpl implements StorageService{
	private StorageMapper storageMapper;

	@Resource
	public void setStorageMapper(StorageMapper storageMapper) {
		this.storageMapper = storageMapper;
		this.baseMapper = storageMapper;
	}

	@Override
	public Storage get(int productId, int depotId) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("productId", productId);
		params.put("depotId", depotId);
		return storageMapper.selectByProductIdAndDepotId(params);
	}

	@Override
	public List<Storage> findByProductId(int productId) {
		return storageMapper.selectByProductId(productId);
	}
	
	
}
